package com.ruoyi.zsyh.controller;

import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.zsyh.domain.ZsyhServiceTypeMoneyother;
import com.ruoyi.zsyh.service.IZsyhServiceTypeMoneyotherService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 其他费用标准Controller
 * 
 * @author yuexl
 * @date 2024-08-22
 */
@Controller
@RequestMapping("/zsyh/serviceTypeMoneyother")
public class ZsyhServiceTypeMoneyotherController extends BaseController
{
    private String prefix = "zsyh/serviceTypeMoneyother";

    @Autowired
    private IZsyhServiceTypeMoneyotherService zsyhServiceTypeMoneyotherService;

    @RequiresPermissions("zsyh:serviceTypeMoneyother:view")
    @GetMapping()
    public String serviceTypeMoneyother()
    {
        return prefix + "/serviceTypeMoneyother";
    }

    /**
     * 查询其他费用标准列表
     */
    @RequiresPermissions("zsyh:serviceTypeMoneyother:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(ZsyhServiceTypeMoneyother zsyhServiceTypeMoneyother)
    {
        startPage();
        List<ZsyhServiceTypeMoneyother> list = zsyhServiceTypeMoneyotherService.selectZsyhServiceTypeMoneyotherList(zsyhServiceTypeMoneyother);
        return getDataTable(list);
    }

    /**
     * 导出其他费用标准列表
     */
    @RequiresPermissions("zsyh:serviceTypeMoneyother:export")
    @Log(title = "其他费用标准", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(ZsyhServiceTypeMoneyother zsyhServiceTypeMoneyother)
    {
        List<ZsyhServiceTypeMoneyother> list = zsyhServiceTypeMoneyotherService.selectZsyhServiceTypeMoneyotherList(zsyhServiceTypeMoneyother);
        ExcelUtil<ZsyhServiceTypeMoneyother> util = new ExcelUtil<ZsyhServiceTypeMoneyother>(ZsyhServiceTypeMoneyother.class);
        return util.exportExcel(list, "其他费用标准数据");
    }

    /**
     * 新增其他费用标准
     */
    @GetMapping("/add")
    public String add()
    {
        return prefix + "/add";
    }

    /**
     * 新增保存其他费用标准
     */
    @RequiresPermissions("zsyh:serviceTypeMoneyother:add")
    @Log(title = "其他费用标准", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @ResponseBody
    public AjaxResult addSave(ZsyhServiceTypeMoneyother zsyhServiceTypeMoneyother)
    {
        return toAjax(zsyhServiceTypeMoneyotherService.insertZsyhServiceTypeMoneyother(zsyhServiceTypeMoneyother));
    }

    /**
     * 修改其他费用标准
     */
    @GetMapping("/edit/{id}")
    public String edit(@PathVariable("id") String id, ModelMap mmap)
    {
        ZsyhServiceTypeMoneyother zsyhServiceTypeMoneyother = zsyhServiceTypeMoneyotherService.selectZsyhServiceTypeMoneyotherById(id);
        mmap.put("zsyhServiceTypeMoneyother", zsyhServiceTypeMoneyother);
        return prefix + "/edit";
    }

    /**
     * 修改保存其他费用标准
     */
    @RequiresPermissions("zsyh:serviceTypeMoneyother:edit")
    @Log(title = "其他费用标准", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    @ResponseBody
    public AjaxResult editSave(ZsyhServiceTypeMoneyother zsyhServiceTypeMoneyother)
    {
        return toAjax(zsyhServiceTypeMoneyotherService.updateZsyhServiceTypeMoneyother(zsyhServiceTypeMoneyother));
    }

    /**
     * 删除其他费用标准
     */
    @RequiresPermissions("zsyh:serviceTypeMoneyother:remove")
    @Log(title = "其他费用标准", businessType = BusinessType.DELETE)
    @PostMapping( "/remove")
    @ResponseBody
    public AjaxResult remove(String ids)
    {
        return toAjax(zsyhServiceTypeMoneyotherService.deleteZsyhServiceTypeMoneyotherByIds(ids));
    }
}
